package com.bailian.spring.ioc.sigleton_lifecycle.config;

import com.bailian.spring.ioc.sigleton_lifecycle.bean.Dog;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @author gaoxu
 * date: Created on 2021/11/1 下午2:58
 */
@Configuration
@ComponentScan("com.bailian.spring.ioc.sigleton_lifecycle.bean")
public class SpringLifeCycleConfig {

    @Bean(initMethod = "init", destroyMethod = "destroy")
    public Dog dog() {
        Dog dog = new Dog();
        dog.setName("大黄");
        return dog;
    }
}
